<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ～ ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------

// you should use `$router`
/* @var think\Route $router */

$router->group('api',function () use ($router){
    # 获取token
    $router->post('getToken', '\catchAdmin\api\controller\Index@getToken');
    # 验证token
    $router->post('checkSign', '\catchAdmin\api\controller\Index@checkSign');
    # 订单服务
    $router->post('orderService/:serviceType', '\catchAdmin\api\controller\Index@orderService');
    # 运单服务
    $router->post('logisticsService/:serviceType', '\catchAdmin\api\controller\Logistics@logisticsService');
    # 海关编码服务
    $router->post('CustomscodeService/:serviceType', '\catchAdmin\api\controller\Customscode@CustomscodeService');

    #菜鸟服务
    $router->post('cainiaoService/:serviceType', '\catchAdmin\api\controller\Cainiao@cainiaoService');
    #候鸟服务
    $router->post('houniaoService/:serviceType', '\catchAdmin\api\controller\Houniao@houniaoService');

    #新生支付
    $router->post('xs/:serviceType', '\catchAdmin\api\controller\Xinsheng@xinshengService');

    #渠道商
    $router->post('goods/:serviceType', '\catchAdmin\api\controller\Goods@goodsService');
    $router->post('order/:serviceType', '\catchAdmin\api\controller\Order@goodsService');


    #新闻
    $router->get('news', '\catchAdmin\api\controller\News@index');//列表
    $router->post('news/abced', '\catchAdmin\api\controller\News@abced');//列表
    $router->get('news1', '\catchAdmin\api\controller\News@index1');//列表
    $router->get('news/:id', '\catchAdmin\api\controller\News@detail')->pattern(['id' => '\d+']);//详情
    $router->get('news/voice/:id', '\catchAdmin\api\controller\News@voice');//语音url
    $router->get('news/latest', '\catchAdmin\api\controller\News@latest');//最新两条文章
    $router->get('news/tempGoods/:goods_spu', '\catchAdmin\api\controller\News@tempGoods');//临时
    $router->get('news/tempGoods2/:goods_spu', '\catchAdmin\api\controller\News@tempGoods2');//临时

});
#海关179公告
$router->get('customs179/getSignText', 'customs179\Jssign@getSignText');
$router->post('customs179/postSignText', 'customs179\Jssign@postSignText');
$router->post('customs179/platDataOpen', 'customs179\Task@platDataOpen');


$router->get('hello', function () {
    return 'hello,world!';
});

//无权限推单接口
//$router->post('api/orderService1/:serviceType', '\catchAdmin\api\controller\Index@orderService');